//package com.jic.weamop.weBankAMOP.configurations;
//
//import lombok.extern.slf4j.Slf4j;
//import org.bcos.channel.client.Service;
//import org.bcos.channel.handler.ChannelConnections;
//import org.bcos.web3j.protocol.Web3j;
//import org.bcos.web3j.protocol.Web3jService;
//import org.bcos.web3j.protocol.channel.ChannelEthereumService;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Qualifier;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//
//import java.util.ArrayList;
//import java.util.List;
//import java.util.concurrent.ConcurrentHashMap;
//
///**
// * @author CiPHER
// */
//@Configuration
//@Slf4j
//public class BlockChainConfiguration {
//
//    @Value("${web3j.test.remote.host1}")
//    private String web3jTestRemoteHostAddress1;
//    @Value("${web3j.test.remote.host2}")
//    private String web3jTestRemoteHostAddress2;
//    @Value("${web3j.test.ca.cert.path}")
//    private String web3jTestCaCertPath;
//    @Value("${web3j.test.keystore.passWord}")
//    private String web3jTestKeystorePassword;
//    @Value("${web3j.test.client.keystore.path}")
//    private String web3jTestClientKeystorePath;
//    @Value("${web3j.test.clientcert.passWord}")
//    private String web3jTestCliendCertPassword;
//
//    @Bean(name = "chainTest")
//    public Service getChannelService1() throws Exception {
//        Service service = new Service();
//        service.setOrgID("test");
//        service.setConnectSeconds(10);
//        service.setConnectSleepPerMillis(10);
//        ConcurrentHashMap<String, ChannelConnections> keyID2connections = new ConcurrentHashMap<>();
//        ChannelConnections channelConnections = new ChannelConnections();
//        channelConnections.setCaCertPath(web3jTestCaCertPath);
//        channelConnections.setClientKeystorePath(web3jTestClientKeystorePath);
//        channelConnections.setKeystorePassWord(web3jTestKeystorePassword);
//        channelConnections.setClientCertPassWord(web3jTestCliendCertPassword);
//        List<String> list = new ArrayList<>();
//        list.add(web3jTestRemoteHostAddress1);
//        list.add(web3jTestRemoteHostAddress2);
//        channelConnections.setConnectionsStr(list);
//        keyID2connections.put("test", channelConnections);
//        service.setAllChannelConnections(keyID2connections);
//        return service;
//    }
//
//}
